
Imports System.Data
Imports System.Data.Sqlclient
Partial Class DeleteDataSource
  Inherits System.Web.UI.Page

  Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
    Dim mySqlConnection As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("VendorStatsConnectionString").ToString)
    Dim mySqlCommand As SqlCommand = New SqlCommand("DeleteDataSourceVendorId", mySqlConnection)
    mySqlCommand.CommandType = CommandType.StoredProcedure
    mySqlCommand.Parameters.Add("@DataSourceVendorId", SqlDbType.Int).Value = ddlDataSourceVendor.SelectedValue
    mySqlConnection.Open()
    mySqlCommand.ExecuteNonQuery()
    mySqlConnection.Close()
    Response.Redirect(Request.Url.ToString)
  End Sub
End Class
